package com.example.swaggerDemo.Dao;


import com.example.swaggerDemo.entity.ArticleEntity;
import com.example.swaggerDemo.entity.MsgEntity;
import org.springframework.web.bind.annotation.RequestParam;

import java.sql.SQLException;
import java.util.List;


public interface ArticleDao {
    /**
     * 获取所有文章
     * @return
     * @throws SQLException
     */
    List<ArticleEntity> findAll(   @RequestParam("pageindex") int pagindex,
                                   @RequestParam("pagesize") int pagesize) throws SQLException;

    /**
     * 根据id获取文章
     * @param id
     * @return
     * @throws SQLException
     */
    ArticleEntity findid(@RequestParam("id") String id) throws SQLException;


    int updateReadcountl(@RequestParam("readcountl") int readcountl,
                         @RequestParam("id") String id);

    int inserarticle(@RequestParam("title") String title,
                     @RequestParam("pretext") String pretext,
                     @RequestParam("preimage") String preimage,
                     @RequestParam("content") String content) throws SQLException;

    int update(
            @RequestParam("id") String id,
            @RequestParam("title") String title,
            @RequestParam("pretext") String pretext,
            @RequestParam("preimage") String preimage,
            @RequestParam("content") String content);

    int delete(@RequestParam("id") String id);
}
